package com.scy.java.object;

import java.util.Scanner;

//测试登录
public class UserInfo {
    public static void main(String[] args) {
        //模拟用户数据库的数据
        User user = new User();
        user.username = "admin";
        user.password = "123456";

        //键盘录入校验
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name = scanner.next();
        System.out.println("请输入密码：");
        String pwd = scanner.next();
        //调用登录方法
//        user.login(name,pwd);
        //测试调用login1()测试登录
        boolean isLogin = user.login1(name, pwd);
        if (isLogin){
            System.out.println("登陆成功,欢迎"+name+"的到来");
        }else{
            System.out.println("登陆失败！用户名或密码错误");
        }



    }
}
